﻿using System;
using System.Collections.Generic;
using System.Text;

namespace AppMain
{
    public class ControlMgr : Singleton<ControlMgr>
    {
        private Dictionary<int, BaseControl> map = null;

        private void addControl()
        {
            map = new Dictionary<int, BaseControl>();
            //add
            map.Add(ControlConst.LoginControl, new PlayerLoginControl());
            map.Add(ControlConst.RoleSyncControl, new RoleSyncControl());
        }

        protected override void initialize()
        {
            addControl();
            foreach (var item in map)
            {
                item.Value.initialize();
            }
            foreach (var item in map)
            {
                item.Value.initEventListener();
            }
        }

        public void init()
        {

        }

        public void dispose()
        {

        }

    }
}
